package com.ccx.coachsite.ui.own;

import java.util.Collections;
import java.util.List;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseExpandableListAdapter;

public class ExpandAdapterBase <T> extends BaseExpandableListAdapter{
	protected Context mContext;
	protected final LayoutInflater mInflater;
	protected List<T> mList1;
	protected List<T> mList2;
	public ExpandAdapterBase(Context context, List<T> list1, List<T> list2) {
		mContext = context;
		mInflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		
		if(list1 == null) {
			mList1 = Collections.emptyList();
		}
		else
		{
			mList1 = list1;
		}
		
		
		if(list2 == null) {
			mList2 = Collections.emptyList();
		}
		else
		{
			mList2 = list2;
		}
	}

	@Override
	public long getChildId(int groupPosition, int childPosition) {
		// TODO Auto-generated method stub
		return childPosition;
	}
	
	@Override
	public View getChildView(int groupPosition, int childPosition,
			boolean isLastChild, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
		return null;
	}
	
	@Override
	public int getChildrenCount(int groupPosition) {
		// TODO Auto-generated method stub
		if(groupPosition == 0)
		{
			return mList1.size();
		}
		else if(groupPosition == 1)
		{
			return mList2.size();
		}
		return 0;
	}
	
	@Override
	public Object getGroup(int groupPosition) {
		// TODO Auto-generated method stub
		return null;
	}
	
	@Override
	public int getGroupCount() {
		return 2;
	}
	
	@Override
	public long getGroupId(int groupPosition) {
		return groupPosition;
	}
	
	@Override
	public View getGroupView(int groupPosition, boolean isExpanded,
			View convertView, ViewGroup parent) {
		return null;
	}
	
	@Override
	public boolean hasStableIds() {
		return false;
	}
	
	@Override
	public boolean isChildSelectable(int groupPosition, int childPosition) {
		return true;
	}

	@Override
	public Object getChild(int groupPosition, int childPosition) {
		return null;
	}
}
